package com.jgsu.farm.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import org.springframework.web.multipart.MultipartFile;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

@NoArgsConstructor
@AllArgsConstructor
@Data
@Table(name = "rule")
public class Rule implements Serializable {
    @Id
    @GeneratedValue(generator = "JDBC", strategy = GenerationType.IDENTITY)
    @NonNull
    private Integer ruleid;

    private String rulename;
    @NonNull
    private Integer author;
    @NonNull
    private Integer stresstype;
    @NonNull
    private Integer cropid;

    private String rulefile;

    private String description;

    public Rule(String rulename, @NonNull Integer author, @NonNull Integer stresstype, @NonNull Integer cropid,
                String rulefile, String description) {
        this.rulename = rulename;
        this.author = author;
        this.stresstype = stresstype;
        this.cropid = cropid;
        this.rulefile = rulefile;
        this.description = description;
    }
}